"use strict";
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        range: Array,
        title: String,
        field: String,
    },
    /**
     * 组件的初始数据
     */
    data: {
        show: false,
        active: '',
        value: "请输入"
    },
    observers: {
        'value': function () {
            this.setData({ active: 'active' });
        },
    },
    /**
     * 组件的方法列表
     */
    methods: {
        onFilterInputTap: function () {
            this.setData({ show: true });
        },
        onSelectItemTap: function (event) {
            var value = event.currentTarget.dataset.value;
            this.setData({ value: value, });
            this.setData({ show: false });
            var fieldValue = {};
            fieldValue[this.data.field] = this.data.range.indexOf(value) + '';
            this.triggerEvent("click", fieldValue, { bubbles: true, composed: true });
        }
    }
});
